﻿<?xml version="1.0" encoding="utf-8"?>
<UserControl
	x:Class="Debugger.AddIn.Pads.ParallelPad.DrawSurface" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Debugger.AddIn.Pads.ParallelPad"
	xmlns:visControls="clr-namespace:Debugger.AddIn.Visualizers.Controls"
	Background="White">
	<UserControl.Resources>
		<LinearGradientBrush
			x:Key="SilverBrushKey"
			EndPoint="0,1"
			StartPoint="0,0">
			<LinearGradientBrush.GradientStops>
				<GradientStop
					Offset="0.7"
					Color="White" />
				<GradientStop
					Offset="1"
					Color="LightGray" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>
		<LinearGradientBrush
			x:Key="SilverPressedBrushKey"
			EndPoint="0,1"
			StartPoint="0,0">
			<LinearGradientBrush.GradientStops>
				<GradientStop
					Offset="0.3"
					Color="White" />
				<GradientStop
					Offset="0"
					Color="LightGray" />
			</LinearGradientBrush.GradientStops>
		</LinearGradientBrush>
		<ControlTemplate
			x:Key="ButtonTemplate"
			TargetType="Button">
			<Border
				Width="28"
				Height="17"
				Name="TheBorder"
				CornerRadius="2,2,2,2"
				BorderThickness="1"
				BorderBrush="LightGray">
				<Canvas>
					<TextBlock
						Canvas.Top="2"
						Canvas.Left="1"
						Text="Reset"
						FontSize="9"
						Foreground="LightGray" />
				</Canvas>
			</Border>
			<ControlTemplate.Triggers>
				<Trigger
					Property="ButtonBase.IsMouseOver"
					Value="True">
					<Setter
						TargetName="TheBorder"
						Property="Background"
						Value="{StaticResource SilverBrushKey}" />
					<Setter
						TargetName="TheBorder"
						Property="BorderBrush"
						Value="Silver" />
				</Trigger>
				<Trigger
					Property="ButtonBase.IsPressed"
					Value="True">
					<Setter
						TargetName="TheBorder"
						Property="Background"
						Value="{StaticResource SilverPressedBrushKey}" />
					<Setter
						TargetName="TheBorder"
						Property="BorderBrush"
						Value="Silver" />
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
	</UserControl.Resources>
	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition
				Width="Auto" />
			<ColumnDefinition
				Width="*" />
		</Grid.ColumnDefinitions>
		<Canvas x:Name="ZoomControl" Width="40" Visibility="Hidden"
			Margin="3,3">
			<TextBlock
				Foreground="LightGray"
				x:Name="PercentText"
				HorizontalAlignment="Center">100%</TextBlock>
			<Line
				X1="0"
				Y1="20"
				X2="28"
				Y2="20"
				StrokeThickness="2"
				Stroke="LightGray" />
			<Slider
				Canvas.Top="23"
				Name="SliderControl"
				Ticks="1,2,3,4,5,6,7,8,9,10"
				Opacity=".4"
				Value="5"
				Interval="1"
				TickPlacement="BottomRight"
				Minimum="1"
				Maximum="10"
				Height="100"
				Width="30"
				Orientation="Vertical"
				ValueChanged="SliderControl_ValueChanged" />
			<Line
				X1="0"
				Y1="125"
				X2="28"
				Y2="125"
				StrokeThickness="2"
				Stroke="LightGray" />
			<Button
				Canvas.Top="130"
				Name="Reset"
				Click="Reset_Click"
				Template="{StaticResource ButtonTemplate}" />
		</Canvas>
		
		<visControls:DragScrollViewer
			x:Name="drawingSurface"			
			Grid.Column="1">
			<Grid
				x:Name="ContentControl"
				VerticalAlignment="Center"
				HorizontalAlignment="Center">
				<local:ParallelStacksGraphLayout
					x:Name="ParallelStacksLayout"
					ShowAllStates="False"
					LayoutAlgorithmType="Tree"
					IsAnimationEnabled="False"
					EdgeRoutingAlgorithmType="Automatic"
					EdgeRoutingConstraint="Automatic"
					OverlapRemovalConstraint="Automatic"
					OverlapRemovalAlgorithmType="FSA" />
			</Grid>
		</visControls:DragScrollViewer>
	</Grid>
</UserControl>